<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
		
		
			#cotainer{
				width: 100%;
				height: 800px;
				display: flex;
				justify-content: center;
				margin-top: 200px;
			}
			#outDiv{
				width: 600px;
				height: 100px;
				overflow: hidden;
			}
			#imgList{
				width: 1600px;
				height: 100px;
				display: flex;
				align-items: center;
				justify-content: center;
			}
			#imgList img{
				width: 100px;
				height: 100px;
			}
		</style>
	</head>
	<body>
		<div id="cotainer">
			<div id="outDiv" onmouseenter="mouseenter();" onmouseleave="mouseleave();">
				<div id="imgList">
					<img src="img/1.jpeg" >
					<img src="img/2.jpeg" >
					<img src="img/3.jpeg" >
					<img src="img/4.jpeg" >
					<img src="img/5.jpeg" >
					<img src="img/6.jpeg" >
					<img src="img/7.jpeg" >
					<img src="img/8.jpeg" >
					<img src="img/9.jpeg" >
					<img src="img/10.jpeg" >
					<img src="img/1.jpeg" >
					<img src="img/2.jpeg" >
					<img src="img/3.jpeg" >
					<img src="img/4.jpeg" >
					<img src="img/5.jpeg" >
					<img src="img/6.jpeg" >
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript">
		var imglistobj=document.getElementById('imgList');
		var marginleft=0;
		var myinter=null;
		var flag =true;
		
		function doaction(){
			if(flag)
			{
				if(marginleft==-1000){
					marginleft=0;
				}
				marginleft--;
				imglistobj.style.marginLeft=marginleft+'px';
				
				if(marginleft%100==0){
					clearInterval(myinter);
					setTimeout(function(){
						// clearInterval(myinter);
						myinter=setInterval(doaction,50);
					},1000)
				}
			}
			}

		function mouseenter(){
			flag = false;
			// clearInterval(myinter);
		}
		function mouseleave(){
			flag  = true;
			// clearInterval(myinter);
			// myinter=setInterval(doaction,50);
		}
		onload = function()
		{
			myinter=setInterval(doaction,50);
		}
	</script>
</html>
